package com.randi.system.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;

/**
 * @author ziye
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("sys_user_role")
@ApiModel(value = "SysUserRole对象", description = "SysUserRole对象")
public class SysUserRole {

    @NotEmpty(message = "角色ID不能为空")
    @TableId(value = "role_id")
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "角色ID")
    private Long roleId;

    @NotEmpty(message = "用户ID不能为空")
    @TableField(value = "user_id")
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "用户ID")
    private Long userId;

}
